window.onload = () => {
    const webview = document.querySelector('webview')

    webview.addEventListener('did-start-loading', ()=>{
        console.log('加载')
    })
    webview.addEventListener('did-stop-loading', ()=>{
        console.log('加载完毕')
        let btn = document.getElementById('su')
        // 给引入的百度页面的搜索按钮改样式
        webview.insertCSS("#su{background: red !important;}")

        webview.executeJavaScript(`
        setTimeout(()=>{
            let input = document.getElementById('kw')
            input.value = '你好'
            btn.click()
        },2000)
        `)
    })
  }